﻿@model OnlineEducation.Data.Entities.Code
@{
    Layout = null;
}

<div class="modal-header">
    @if (Model.ID != 0)
    {
        <h4 class="modal-title">修改</h4>
    }
    else
    {
        <h4 class="modal-title">新增</h4>
    }

    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form onsubmit="return SubmitAddEdit(this)">
    <div class="modal-body p-4">

        <div asp-validation-summary="ModelOnly" class="text-danger"></div>
        <input type="hidden" asp-for="ID" />

        <div class="row">
            <div class="col-md-12">

                <div class="form-group">
                    <label for="Category" class="control-label">类型</label>
                    <select asp-for="Category" class="form-control" asp-items="Html.GetEnumSelectList<OnlineEducation.Enums.SysParaCategory>()"></select>
                    <span asp-validation-for="Category" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label for="Name" class="control-label">名字</label>
                    @if (Model.ID != 0 && Model.Category == "1")
                    {
                        <input asp-for="Name" readonly class="form-control" />
                    }
                    else
                    {
                        <input asp-for="Name" class="form-control" />
                    }

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">

                <div class="form-group">
                    <label for="Value" class="control-label">值</label>
                    <input asp-for="Value" class="form-control" />

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">


                <div class="form-group">
                    <label for="Value2" class="control-label">值2</label>
                    <input asp-for="Value2" class="form-control" />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">

                <div class="form-group">
                    <label for="Value2" class="control-label">值3</label>
                    <input asp-for="Value2" class="form-control" />
                </div>

            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label asp-for="Status" class="control-label"></label>
                    <select asp-for="Status" class="form-control" asp-items="Html.GetEnumSelectList<OnlineEducation.Enums.Status>()"></select>
                    <span asp-validation-for="Status" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label for="Remark" class="control-label">备注</label>
                    <textarea asp-for="Remark" rows="5" class="form-control"></textarea>
                </div>
            </div>
        </div>
    </div>

    <div class="modal-footer">
        <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary waves-effect waves-light">保存</button>
    </div>
</form>
<script>
    Ladda.bind('.btn-primary', { timeout: 1000 });
</script>



